<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="include :: header"></head>
<body>
<div style="padding: 15px">
    <form class="layui-form" action="">
        <input id="treeId" name="projectId" type="hidden"/>
        <div class="layui-form-item">
            <label class="layui-form-label">任务标题</label>
            <div class="layui-input-block">
                <input type="text" name="workTitle" lay-verify="required" autocomplete="off"
                       class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">项目名称</label>
            <div class="layui-input-block">
                <input class="layui-input" type="text" onclick="selectEpointProjectTree()" id="treeName" readonly="true"
                       name="projectName"/>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">工作类型</label>
                <div class="layui-input-inline">
                    <select name="workType" id="workType" lay-verify="required" lay-search="">
                        <option value="P">项目需求</option>
                        <option value="B">知识库</option>
                        <option value="G">评审设计</option>
                    </select>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">任务状态</label>
                <div class="layui-input-inline">
                    <select name="status" id="status" lay-verify="required" lay-search="">
                        <option value="E">完结</option>
                        <option value="D">延续</option>
                    </select>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">计划工时(h)</label>
                <div class="layui-input-inline">
                    <input type="number" name="totalHour" lay-verify="required" autocomplete="off"
                           class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">本周工时(h)</label>
                <div class="layui-input-inline">
                    <input type="number" name="weeklyHour" lay-verify="required" autocomplete="off"
                           class="layui-input">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">截止日期</label>
                <div class="layui-input-inline">
                    <input type="text" name="endDate" id="endDate" lay-verify="date" placeholder="yyyy-MM-dd"
                           autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">完成时间</label>
                <div class="layui-input-inline">
                    <input type="text" name="finishDate" id="finishDate" lay-verify="date" placeholder="yyyy-MM-dd"
                           autocomplete="off" class="layui-input">
                </div>
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">工作内容</label>
            <div class="layui-input-block">
                   <textarea type="text" name="workContent" autocomplete="off"
                             class="layui-textarea"></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit="" lay-filter="epointweeklywork">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
    /*<![CDATA[*/
    var sysUrl = '/venus/project/epointweeklywork';
    layui.use(['form', 'laydate'], function () {
        var form = layui.form, laydate = layui.laydate;
        laydate.render({
            elem: '#endDate'
        });
        laydate.render({
            elem: '#finishDate'
        });
        form.on('submit(epointweeklywork)', function (data) {
            data.field.projectId = $("#treeId").val();
            data.field.projectName = $("#treeName").val();
            save(sysUrl, 'add', data.field);
            return false;
        });
    });
    /*]]>*/
</script>
</body>
</html>